#! /usr/bin/python

import PyBaseball
import cgi
thisgame=PyBaseball.PyBaseball()

print "Content-type: text/html"
print
print "<HTML>"
print "<HEAD>"
print "<TITLE>Subscription Successful</TITLE>"
print "</HEAD>"
print "<BODY BGCOLOR='#ffffff' >"
print "<PRE>"

# Check for variables passed in from web page and set defaults
form = cgi.FieldStorage()
if form.has_key('hometeam'):
  homename = form['hometeam'].value
else:
  homename="Rockies"
if form.has_key('awayteam'):
  awayname = form['awayteam'].value
else:
  awayname="Giants"

homestring="hometeam="+homename
awaystring="awayteam="+awayname

thisgame.main([homestring,awaystring,"-cgi"])

print "</PRE>"
print "</BODY>"
print "</HTML>"
